home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0799 / 448 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  2.4 KB

  1. From: mk@anuurn.do.open.de (Martin Koehling)
  2. Subject: Two Patches for MiNT 1.09
  3. Date: Mon, 23 Aug 1993 20:24:32 MEZ
  4. Mime-Version: 1.0
  5.  
  6. Hi!
  7.  
  8. There is a small bug in proc.c: when the system runs out of kernel
  9. memory while allocating memory for a fork()ed processes' region map,
  10. duplicated FILEPTRs and cookies are not released; moving the memory
  11. allocation code up a few lines should cure the problem:
  12.  
  13. *** o:\proc.c    Wed Aug 18 20:16:34 1993
  14. --- proc.c    Wed Aug 18 22:00:04 1993
  15. ***************
  16. *** 122,127 ****
  17. --- 122,140 ----
  18.  
  19.       p->usrtime = p->systime = p->chldstime = p->chldutime = 0;
  20.  
  21. + /* allocate space for memory regions, to be filled later */
  22. +     p->mem = (MEMREGION **) kmalloc(p->num_reg * SIZEOF(MEMREGION *));
  23. +     if (!p->mem) {
  24. +         dispose_proc(p);
  25. +         goto nomem;
  26. +     }
  27. +     p->addr = (virtaddr *)kmalloc(p->num_reg * SIZEOF(virtaddr));
  28. +     if (!p->addr) {
  29. +         kfree(p->mem);
  30. +         dispose_proc(p);
  31. +         goto nomem;
  32. +     }
  33. +
  34.   /* copy open handles */
  35.       for (i = MIN_HANDLE; i < MAX_OPEN; i++) {
  36.           if ((f = p->handle[i]) != 0) {
  37. ***************
  38. *** 149,166 ****
  39.       p->searches = 0;
  40.  
  41.   /* copy memory */
  42. -     p->mem = (MEMREGION **) kmalloc(p->num_reg * SIZEOF(MEMREGION *));
  43. -     if (!p->mem) {
  44. -         dispose_proc(p);
  45. -         goto nomem;
  46. -     }
  47. -     p->addr = (virtaddr *)kmalloc(p->num_reg * SIZEOF(virtaddr));
  48. -     if (!p->addr) {
  49. -         kfree(p->mem);
  50. -         dispose_proc(p);
  51. -         goto nomem;
  52. -     }
  53. -
  54.       for (i = 0; i < curproc->num_reg; i++) {
  55.           p->mem[i] = curproc->mem[i];
  56.           if (p->mem[i] != 0)
  57. --- 162,167 ----
  58.  
  59. Another (small) problem in dosound() (xbios.c): when it is compiled
  60. with Pure C, the #&$$@6"6$& optimizer silently removes the statement
  61. "(void)(*((volatile char *)ptr));".
  62.  
  63. A simple patch should fix this:
  64.  
  65. *** o:\xbios.c    Wed Aug 18 20:16:50 1993
  66. --- xbios.c    Mon Aug 23 19:43:06 1993
  67. ***************
  68. *** 269,275 ****
  69.       if (!no_mem_prot && ((long)ptr >= 0)) {
  70.       /* check that this process has access to the memory */
  71.       /* (if not, the next line will cause a bus error) */
  72. !         (void)(*((volatile char *)ptr));
  73.  
  74.       /* OK, now make sure that interrupt routines will have access,
  75.        * too
  76. --- 269,276 ----
  77.       if (!no_mem_prot && ((long)ptr >= 0)) {
  78.       /* check that this process has access to the memory */
  79.       /* (if not, the next line will cause a bus error) */
  80. !         char dummy = (*((volatile char *)ptr));
  81. !         UNUSED(dummy) ;
  82.  
  83.       /* OK, now make sure that interrupt routines will have access,
  84.        * too
  85.  
  86. -- 
  87.  Martin Koehling | mk@anuurn.do.open.de | Martin_Koehling@un.maus.ruhr.de
  88.